home *** CD-ROM | disk | FTP | other *** search
/ Ultra Gameplayers 101 / Ultra Game Players Magazine, No. 101 - September 1997 (Imagine Publishing, Inc.)(1997).iso / pc / new_ugp.dxr / 00030.ls < prev    next >
Encoding:
Text File  |  1997-07-10  |  952 b   |  49 lines

  1. on fb
  2.   put the freeBlock / 1000 & " kb"
  3. end
  4.  
  5. on translateColor nPCPaletteVal
  6.   if not isMac() then
  7.     return nPCPaletteVal
  8.   end if
  9.   if the colorDepth = 8 then
  10.     return nPCPaletteVal
  11.   end if
  12.   case nPCPaletteVal of
  13.     0:
  14.       set rgb to [255, 255, 255]
  15.     5:
  16.       set rgb to [0, 255, 0]
  17.     6:
  18.       set rgb to [255, 0, 0]
  19.     9:
  20.       set rgb to [251, 255, 240]
  21.     13:
  22.       set rgb to [0, 51, 153]
  23.     251:
  24.       set rgb to [0, 0, 128]
  25.     255:
  26.       set rgb to [0, 0, 0]
  27.     otherwise:
  28.       set rgb to [251, 255, 240]
  29.   end case
  30.   if the colorDepth = 16 then
  31.     return rgb32(rgb)
  32.   else
  33.     if the colorDepth > 16 then
  34.       return rgb256(rgb)
  35.     end if
  36.   end if
  37. end
  38.  
  39. on rgb32 rgbList
  40.   set r to getAt(rgbList, 1) / 8
  41.   set g to getAt(rgbList, 2) / 8
  42.   set b to getAt(rgbList, 3) / 8
  43.   return (r * 1024) + (g * 32) + b
  44. end
  45.  
  46. on rgb256 rgbList
  47.   return (getAt(rgbList, 1) * 256 * 256) + (getAt(rgbList, 2) * 256) + getAt(rgbList, 3)
  48. end
  49.